<include file="Common:header" /> 

<!--主窗体-->
<div class="container app">
	<!--左侧菜单-->
	<include file="Common/sidebar" /> 
	<!--左侧菜单//-->
	
	<!-- mainCon -->
	<div id="mainCon" class="mainCon">
		<h4>站内列表</h4>
		<div>
		<!-- <form class="form-inline" method="get">
			<div class="form-group form-group-sm">
				<label for="title">标题：</label>
				<input type="text" class="form-control" id="title" name="title" placeholder="文章标题" value="<{$title}>">
			</div>
			<div class="form-group form-group-sm">
				<label for="">创建时间：</label>
				<input type="text" class="form-control laydate-icon" id="start_time" name="start_time"  value="<{$start_time?($start_time|date='Y-m-d H:i:s',###):''}>" >
				<span>-</span>
				<input type="text" class="form-control laydate-icon" id="end_time" name="end_time"  value="<{$end_time?($end_time|date='Y-m-d H:i:s',###):''}>" >
			</div>
		
			<div class="form-group form-group-sm">
				<label for="member_disable">状态：</label>
				<select id="status" name="status" class="form-control">
					<option value="all" <if condition="$status eq 'all'"></if>>全部</option>
					<option value="1" <if condition="$status eq 1"></if>>显示</option>
					<option value="0" <if condition="$status eq 0"></if>>隐藏</option>
				</select>
			</div>
			<button type="submit" class="btn btn-default btn-sm">文章筛选</button>
		</form> -->
		</div>
		<div class="bk10"></div>
		<!-- <div>
			<a href="<{:U('Admin/ArticleSite/articleAdd',array('k'=>1,'sk'=>11))}>" class="btn btn-default">添加文章</a>
		</div> -->
		<div class="bk10"></div>
		<table class="table table-bordered table-hover">
			<tr>
				<th>规则名称</th>
				<th>关键字</th>
				<th>操作</th>
			</tr>

			<empty name="list">
				<tr><td colspan="8" style="text-align:center;color:#999">～暂无数据～</td></tr>
			<else /> 

				<foreach name="list" item="vo">
					<tr>
						<td><{$vo['name']}></td>
						<td>
							<volist name="vo['keywords']" id="kw">
								<span class="label label-success"><{$kw['content']}></span>&nbsp;&nbsp;
							</volist>
						</td>
						<td>
							<a href="<{:U('News/Rule/PostKeyword',array('id'=>$vo['id'],'k'=>9,'sk'=>3))}>">编辑</a>
							<a href="javascript:void(0)" data_href="<{:U('Rule/RuleDelete', array('id' => $vo['id']))}>" class="delAct" >删除</a>
						</td>
					</tr>
				</foreach>
			
			</empty>
			
		</table>
		
		<div class="pagebar">
			<{$pager}>
		</div>
		
	</div>
	<!-- mainCon// -->
	
</div>
<!--主窗体//-->

<script src="__PUBLIC__/js/layer/layer.js"></script>
<script>
$(function(){

	/*var start = {
		elem: '#start_time',
		format: 'YYYY/MM/DD hh:mm:ss',
		istime: true,
		istoday: false,
		choose: function(datas){
			 end.min = datas;
			 end.start = datas;
		}
	};
	var end = {
		elem: '#end_time',
		format: 'YYYY/MM/DD hh:mm:ss',
		istime: true,
		istoday: false,
		choose: function(datas){
			start.max = datas;
		}
	};
	laydate(start);
	laydate(end);*/
	
	$(".delAct").click(function(){
		var url = $(this).attr('data_href');
		var thisobj = $(this);
		layer.confirm('删除规则将同时删除关键字与回复，确认吗？', function(index){
			$.get(url,function(d){
				if(d.status){
					thisobj.parent().parent().remove();
					layer.alert('删除成功');
				}else{
					layer.alert('删除失败');
				}
				
				//message(d.info,d.url,d.status);
			});

		    layer.close(index);
		}, function(index){
		    layer.close(index);
		});
		
		return false;
	});
});
</script>

<include file="Public/footer" /> 